home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _134630B6762340FCAADCF76B033B3207 < prev    next >
Encoding:
Text File  |  2004-01-06  |  751 b   |  34 lines

  1.  
  2.       #include "../CGVPMacro.csi"
  3.  
  4.  
  5.       NoFog
  6.       UnifiedPosScript
  7.       
  8.       VertAttributes { POSITION_3 }
  9.       MainInput { VIEWPROJ_MATRIX, uniform float2x4 FogMatrix, uniform float2x4 FogEnterMatrix }
  10.       DeclarationsScript
  11.       {
  12.         IN_P
  13.         OUT_T0
  14.       }
  15.       PositionScript = PosCommon                 
  16.       CoreScript
  17.       {
  18.           // y
  19.           float2 tex0;
  20.           tex0.xy = mul(FogEnterMatrix, vPos);
  21.  
  22.           //x
  23.           float2 temp = mul(FogMatrix, vPos);
  24.           temp.x -= 0.5f;
  25.           temp.x = abs(temp.x);
  26.           temp.x = clamp(temp.x,0,.4921875f); //63.f/128.f = .4921875
  27.  
  28.           if(tex0.x > 0.5)
  29.               temp.x += 0.5;
  30.           tex0.x = temp.x;
  31.  
  32.           OUT.Tex0.xy = tex0;
  33.       }
  34.